Skip to content

Centralise hardcoded constants into named symbols#48

Merged
adrunkhuman merged 1 commit intomasterfrom
refactor/centralise-constants
Apr 12, 2026
Merged

Centralise hardcoded constants into named symbols#48
adrunkhuman merged 1 commit intomasterfrom
refactor/centralise-constants

Conversation

@adrunkhuman
Copy link
Copy Markdown
Owner

Summary

  • Creates internal/site/config.go with BaseURL, ArchiveURL, and HTTPTimeout to replace scattered magic strings and literals in the transport layer.
  • Adds cmdTimeout in internal/ui/commands.go (kept near the command layer per the issue guidance) and replaces all 5 inline 20*time.Second literals.
  • client.go and update.go now reference the named constants instead of inline literals.

Fixes #31

Test plan

  • go build ./... — no import errors, all constants resolve correctly.
  • go test ./... — all existing tests pass unchanged.

Fixes #31 — collects scattered magic values into one place:
- internal/site/config.go: BaseURL, ArchiveURL, HTTPTimeout
- internal/ui/commands.go: cmdTimeout (20s, stays near command layer)

client.go and update.go now reference the named constants instead of
inline literals.
@adrunkhuman adrunkhuman merged commit a16592b into master Apr 12, 2026
1 check passed
@adrunkhuman adrunkhuman deleted the refactor/centralise-constants branch April 12, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralise hardcoded constants (base URL, timeouts)

1 participant